﻿
/*
* myTools.c
* 工具函数
* 2012 - 8 - 22 westice
*/

#include "myTools.h"

beginTime = 0;
useTime = 0;
char* testTimeFlag = "xx";


hasSetRandSand = 0;
int myRandInt(ix0,ix1){
	MYASSERT(ix1>ix0) 
	onceSrand
	return ((rand()%(ix1 - ix0))) + ix0;
}

float myRandFloat(fx0,fx1){
	MYASSERT(fx1>fx0) 
	onceSrand
	return (fx1 - fx0)*myRandFloatOne + fx0;
}



myRange createMyRange(int pos,int length){
	myRange range = {pos,length};
	return range;
}
 
 
void printDataStructSize(){
	//printf(":%d\n",);
	PRINTDATASIZE(int)
	PRINTDATASIZE(short)
	PRINTDATASIZE(char)
	PRINTDATASIZE(float)
	PRINTDATASIZE(double)
	PRINTDATASIZE(long)
	PRINTDATASIZE(long long)
	PRINTDATASIZE(long double)
	
	PRINTDATASIZE(myRange)
} 

